<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>

selection_test(
  '<div contenteditable dir="rtl">|\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">|\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-0 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6|\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">|\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-1 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC|\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6|\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-2 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC|\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-3 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-4 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n|        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-5 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n |       <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-6 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n  |      <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-7 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n   |     <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-8 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n    |    <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-9 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n     |   <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-10 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n      |  <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-11 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n       | <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-12 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        |<div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7|\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-13 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div>|</div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-14 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>|\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-15 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n|        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-16 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n |       \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-17 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n  |      \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-18 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n   |     \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-19 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n    |    \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-20 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n     |   \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-21 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n      |  \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-22 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n       | \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-23 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        |\u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA|\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-24 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE|\u05E6\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        |\u05DE\u05E6\u05E0\u05E4\u05EA</div>',
  '24-25 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6|\u05E0\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE|\u05E6\u05E0\u05E4\u05EA</div>',
  '24-26 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0|\u05E4\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6|\u05E0\u05E4\u05EA</div>',
  '24-27 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4|\u05EA</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0|\u05E4\u05EA</div>',
  '24-28 rtl right character');

selection_test(
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4\u05EA|</div>',
  selection => selection.modify('move', 'right', 'character'),
  '<div contenteditable dir="rtl">\u05E6\u05DC\u05D7\u05EA\n        <div></div>\n        \u05DE\u05E6\u05E0\u05E4|\u05EA</div>',
  '24-29 rtl right character');
</script>
